﻿<UserControl x:Class="WowModelExplorer.Controls.CharacterSelect"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:control="clr-namespace:WowModelExplorer.Controls"
             xmlns:data="clr-namespace:WowModelExplorer.Data"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignHeight="500"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Grid Name="_mainGrid">
        <Grid.Resources>
            <data:RaceInfoCollection x:Key="_allianceRaces" />
            <data:RaceInfoCollection x:Key="_hordeRaces" />
            <data:StartOutfitClassCollection x:Key="_startOutfitClasses" />
            <data:CharFeature x:Key="_maxCharFeature" />
            <data:CharFeature x:Key="_currentCharFeature" />

            <Style x:Key="ListBoxStyle" TargetType="{x:Type ListBox}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBox}">
                            <Border>
                                <WrapPanel HorizontalAlignment="Center"
                                           IsItemsHost="True"
                                           Orientation="Horizontal" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition Height="200" />
            <RowDefinition Height="1" />
            <RowDefinition Height="60" />
            <RowDefinition Height="1" />
            <RowDefinition Height="120" />
            <RowDefinition Height="1" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <GroupBox Grid.Column="0" Header="{DynamicResource alliance}">
                <ListBox Name="_lbAlliance"
                         DisplayMemberPath="Name"
                         FontSize="14"
                         ItemsSource="{StaticResource _allianceRaces}" />
            </GroupBox>
            <GroupBox Grid.Column="1" Header="{DynamicResource horde}">
                <ListBox Name="_lbHorde"
                         DisplayMemberPath="Name"
                         FontSize="14"
                         ItemsSource="{StaticResource _hordeRaces}" />
            </GroupBox>
        </Grid>

        <GridSplitter Grid.Row="1"
                      Height="1"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Background="{DynamicResource EdgeBorderBrush}" />

        <GroupBox Grid.Row="2" Header="{DynamicResource gender}">
            <StackPanel HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Orientation="Horizontal">
                <RadioButton Name="_rbMale"
                             Margin="0,0,5,0"
                             FontSize="14"
                             GroupName="Gender"
                             Content="{DynamicResource male}" />
                <RadioButton Name="_rbFemale"
                             Margin="5,0,0,0"
                             FontSize="14"
                             GroupName="Gender"
                             Content="{DynamicResource female}"/>
            </StackPanel>
        </GroupBox>

        <GridSplitter Grid.Row="3"
                      Height="1"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Background="{DynamicResource EdgeBorderBrush}" />

        <GroupBox Grid.Row="4" Header="{DynamicResource class}">
            <ListBox Name="_lbClasses"
                     Margin="10, 10, 3, 3"
                     HorizontalAlignment="Center"
                     DisplayMemberPath="Name"
                     FontSize="14"
                     ItemsSource="{StaticResource _startOutfitClasses}"
                     Style="{StaticResource ListBoxStyle}" />
        </GroupBox>

        <GridSplitter Grid.Row="5"
                      Height="1"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Background="{DynamicResource EdgeBorderBrush}" />

        <GroupBox Grid.Row="6" Header="{DynamicResource feature}">
            <StackPanel>
                <control:SliderSelector
                                        Margin="2,4,2,2"
                                        Description="{DynamicResource skinColor}"
                                        FontSize="14"
                                        Maximum="{Binding Source={StaticResource _maxCharFeature},
                                                          Path=SkinColor}"
                                        Value="{Binding Source={StaticResource _currentCharFeature},
                                                        Path=SkinColor,
                                                        Mode=TwoWay}" />
                <control:SliderSelector
                                        Margin="2"
                                        Description="{DynamicResource faceType}"
                                        FontSize="14"
                                        Maximum="{Binding Source={StaticResource _maxCharFeature},
                                                          Path=FaceType}"
                                        Value="{Binding Source={StaticResource _currentCharFeature},
                                                        Path=FaceType,
                                                        Mode=TwoWay}" />
                <control:SliderSelector
                                        Margin="2"
                                        Description="{DynamicResource hairType}"
                                        FontSize="14"
                                        Maximum="{Binding Source={StaticResource _maxCharFeature},
                                                          Path=HairStyle}"
                                        Value="{Binding Source={StaticResource _currentCharFeature},
                                                        Path=HairStyle,
                                                        Mode=TwoWay}" />
                <control:SliderSelector
                                        Margin="2"
                                        Description="{DynamicResource facialHair}"
                                        FontSize="14"
                                        Maximum="{Binding Source={StaticResource _maxCharFeature},
                                                          Path=FacialHair}"
                                        Value="{Binding Source={StaticResource _currentCharFeature},
                                                        Path=FacialHair,
                                                        Mode=TwoWay}" />
                <control:SliderSelector
                                        Margin="2,2,2,4"
                                        Description="{DynamicResource hairColor}"
                                        FontSize="14"
                                        Maximum="{Binding Source={StaticResource _maxCharFeature},
                                                          Path=HairColor}"
                                        Value="{Binding Source={StaticResource _currentCharFeature},
                                                        Path=HairColor,
                                                        Mode=TwoWay}" />
            </StackPanel>
        </GroupBox>

    </Grid>
</UserControl>
